package cmd

import (
	"gitee.com/xuender/se"
	"github.com/spf13/cobra"
)

// nolint: gochecknoinits
func init() {
	reindexCmd := &cobra.Command{
		Use:     "reindex",
		Short:   "重新索引",
		Long:    `重新索引已经索引过的文件目录`,
		Aliases: []string{"r", "ri"},
		Run: func(cmd *cobra.Command, args []string) {
			app := se.InitApp(se.NewContext(cmd))
			defer app.Close()

			app.Reindex()
		},
	}

	rootCmd.AddCommand(reindexCmd)
}
